home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / PCI Driver Development Kit / • Tools / Development / NCR.flash / makecreate < prev    next >
Encoding:
Text File  |  1996-08-20  |  1.1 KB  |  41 lines  |  [TEXT/MPS ]

  1. #
  2. #    makecreate
  3. #
  4. # This script accepts an input file which is the binary image of a PCI expansion
  5. # card ROM and converts it to a series of Forth commands which can be downloaded
  6. # into the Open Firmware user interface and which will create a Forth array
  7. # named image-start which contains the binary image.
  8. #
  9. # Commands to leave the address and length of the image on the stack after the
  10. # download will be included in the resulting file, in anticipation of the execution
  11. # of the nv-flash command to flash the image into an NCR card.
  12. #
  13. #     syntax: makecreate infile outfile
  14. #
  15. #      by Monte Benaresh  November 7, 1994
  16. #
  17.  
  18.  
  19. if {#} != 2
  20.     echo '### makecreate--must have 2 parameters'
  21.     exit
  22. end
  23.  
  24. set sourcefile {1}
  25. set destfile {2}
  26.  
  27. dumpfile -a -o -g 4 "{sourcefile}" > "{destfile}"
  28.  
  29. open "{destfile}"
  30. find • "{destfile}"
  31. replace -c 5 /?*∂n/ "" "{destfile}"
  32. replace /∂n/ "create image-start∂n" "{destfile}"
  33. replace -c ∞ /([0-9a-f]«8»)®1/ ®1" , " "{destfile}"
  34. replace /≈/ "∂nimage-start dup here swap -∂n" "{destfile}"
  35.  
  36. save "{destfile}"
  37. close "{destfile}"
  38.  
  39. # example--> makecreate myrom.bin myrom.create
  40.  
  41.